import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Login from '../components/Login.vue'
import Predict from '../components/Predict.vue'
import HealthData from "@/components/HealthData.vue";
import History from '@/components/History.vue'

const routes = [
  {
    path: '/',
    redirect: 'login'

  },
  {
    path: '/predict',
    name: 'predict',
    component: Predict,
    meta: { title:'预测页面',
      requiresAuth: true }
  },
  {
    path: '/healthdata',
    name: 'healthdata',
    component: HealthData,
    meta: {
      title: '健康检测结果',
      requiresAuth: true
    }
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
    meta: {
      title:'登录',
      requiresAuth: false
    }

  },
  {
    path: '/history',
    name: 'history',
    component: History,
    meta: {
      title:'历史记录查询',
      requiresAuth: true
    }

  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
});



export default router

